<template>
    <div class="index-container" style="overflow: hidden">
        <!-- 导航栏 -->
        <indexNavBar
                :title="$route.meta.title"
                :back="false"
                @click-left="$router.go(-1)"
        ></indexNavBar>
        <!-- 消息列表-->
        <div class="content-scroll">
            <template v-for="(item, index) in list">
                <message-card
                    :style=" index == 0 ? {'margin-top': '10px' } :''"
                    :key="index"
                    :cardInfo="item"
                ></message-card>
            </template>
            <!--<indexListNone v-if="list.length == 0" :prompt="'未能找到流水清单'" />-->
        </div>
    </div>
</template>

<script>
import indexNavBar from '../../components/style/index-nav-bar.vue'
import messageCard from './components/message-card.vue'
export default {
    components: {
        indexNavBar,
        messageCard
    },

    data () {
        return {
            list: []
        }
    },
    mounted () {
        setTimeout(() => {
            this.init()
        }, 50)
    },
    methods: {
        /* 初始化 */
        init () {
            this.getMessage()
        },
        async getMessage () {
            let _ = this
            try {
                _.$U.showLoading(_)
                const res = await _.$H.get(_, _.$A.message.list, { corpNo: this.$C.corpNo })
                // _.list = [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}]
                _.list = res.data
                console.log(res.data)
                _.$U.hideLoading(_)
            } catch (e) {
                _.$U.hideLoading(_)
            }
        }
    }
}
</script>

<style lang="less" scoped>
.content-scroll {
    width: 100%;
    height: calc(100% - 155px);
    overflow: auto;
    margin-top: 15px;
}
</style>
